<div id='tonights_meals'>
	<ul data-role='listview'>
		<li style='text-align: center'>Currently logged in as '<?=$username?>'</li>
	</ul>
	<?if (isset($payload)):?>
        <?foreach($payload as $x):?>
            <div data-role="collapsible" data-inset="false" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d" data-iconpos='right' >
            <h3><?=$x->name?></h3>

            <button type="text" data-inline="true" class="vote" value="<?=$x->id?>" 
            data-mini="true" data-corners="false" data-theme="b" onclick="voteTonight(this)">
            <? if ($x->voted == 1):
            	echo "Voted";
            else:
            	echo "Vote";
            endif;?>
            </button> 
<?if ($x->orderable == 1):?>
            <button type="text" data-inline="true" class="order" value="<?=$x->id?>" 
            data-mini="true" data-corners="false" data-theme="b" onclick="orderTonight(this)">
            <? if ($x->ordered == 1):
            	echo "Ordered";
            else:
            	echo "Order";
			endif;?>
            </button>
<?endif;?>
            <p class='title'>Details:</p>
            <p class='description'><?=$x->description?></p>
			</div>
		<?endforeach;?>
		<?else:?>
		<div class='mobile-padding'>
		No meals for today.
		</div>
		<?endif;?>
	</div>
	
